
		
#ifndef dex_types_h
#define dex_types_h
#include <stdio.h>
#include "leb128.h"

typedef unsigned char ubyte;
typedef unsigned short ushort;
typedef unsigned int uint;

//typedef  char byte;



//
class CDexByte
{

public:
	signed char value;


	void print() {printf("%02x",value);}
	int sprint( char *buffer) {return sprintf(buffer,"%02x",value);}
	int Size(){return sizeof(value);}

};
//
class CDexUbyte
{

public:
	unsigned char value;


	void print() {printf("%02x",value);}
	int sprint( char *buffer) {return sprintf(buffer,"%02x",value);}
	int Size(){return sizeof(value);}

};
// little-endian
class CDexShort
{

public:
	signed short value;


	void print() {printf("%04x",value);}
	int sprint( char *buffer) {return sprintf(buffer,"%04x",value);}
	int Size(){return sizeof(value);}

};
// little-endian
class CDexUshort
{

public:
	unsigned short value;


	void print() {printf("%04x",value);}
	int sprint( char *buffer) {return sprintf(buffer,"%04x",value);}
	int Size(){return sizeof(value);}

};
// little-endian
class CDexInt
{

public:
	signed int value;


	void print() {printf("%08x",value);}
	int sprint( char *buffer) {return sprintf(buffer,"%08x",value);}
	int Size(){return sizeof(value);}

};
// little-endian
class CDexUint
{

public:
	unsigned int value;


	void print() {printf("%08x",value);}
	int sprint( char *buffer) {return sprintf(buffer,"%08x",value);}
	int Size(){return sizeof(value);}

};
// little-endian
class CDexLong
{

public:
	signed __int64 value;


	void print() {printf("%016x",value);}
	int sprint( char *buffer) {return sprintf(buffer,"%016x",value);}
	int Size(){return sizeof(value);}

};
// little-endian
class CDexUlong
{

public:
	unsigned __int64 value;


	void print() {printf("%016x",value);}
	int sprint( char *buffer) {return sprintf(buffer,"%016x",value);}
	int Size(){return sizeof(value);}

};
// variable-length (see below)
class CDexSleb128
{

public:
	signed char value;


	void print() { print_leb128((const char *)&value);}
	int sprint( char *buffer) {return sprint_leb128(buffer,(const char *)&value);}
	int Size(){return size_leb128((const char *)&value);}

	int to_int(){return value_leb128((const char *)&value);}	
};
// variable-length (see below)
class CDexUleb128
{

public:
	unsigned char value;


	void print() { print_leb128((const char *)&value);}
	int sprint( char *buffer) {return sprint_leb128(buffer,(const char *)&value);}
	int Size(){return size_leb128((const char *)&value);}

	int to_int(){return value_leb128((const char *)&value);}	
};
// variable-length (see below)
class CDexUleb128p1
{

public:
	unsigned char value;


	void print() { print_leb128((const char *)&value);}
	int sprint( char *buffer) {return sprint_leb128(buffer,(const char *)&value);}
	int Size(){return size_leb128((const char *)&value);}

	int to_int(){return value_leb128((const char *)&value)-1;}
};

#endif//dex_types_h		

